-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DuckDB tests #1970
Add DuckDB tests #1970
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably fine - I will need to try it locally - will try to do tomorrow
I'm happy to merge as-is, but FYI: this doesn't actually work for netfx - I see that there's a <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DuckDB.NET.Data.Full" Version="0.9.0.3"/>
</ItemGroup>
</Project> with: using DuckDB.NET.Data;
using var conn = new DuckDBConnection("Data Source=:memory:");
conn.Open(); gives: Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'duckdb': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at DuckDB.NET.NativeMethods.Startup.DuckDBOpen(String path, DuckDBDatabase& database, DuckDBConfig config, IntPtr& error)
at DuckDB.NET.Data.Internal.ConnectionManager.GetConnectionReference(DuckDBConnectionString connectionString)
at DuckDB.NET.Data.DuckDBConnection.Open()
at Program.<Main>$(String[] args) in C:\Code\ConsoleApp7\ConsoleApp7\Program.cs:line 4 The packaging might not be right. I haven't looked to see what you're packaging and how - it doesn't look like there are native binaries in the nupkg itself, so I'm guessing that they are embedded resources in the dll? More of a topic for DuckDB, but you might prefer to embed them in the nupkg rather than the dll; I also haven't checked to see how the unmanaged dll works re cross-platform (normally I'd expect to see a bunch of platform-specific native dlls in the nupkg, for this purpose) (let me know if you need any help with any of this) |
It doesn't work for netfx but works for net core. The native libraries are under |
The native libraries are in another package that the top level depends on DuckDB.NET.Bindings.Full |
logged here: Giorgi/DuckDB.NET#151 - I guess the key bit is "it didn't work" |
@Giorgi ah, it is 32-bit vs 64-bit; see 151 |
(I still can't get the tests to run in netfx, but my standalone console works 🤷) |
I'm using SDK-style project, so this should work; it now works for the standalone console, if I explicitly use x64 rather than the implicit anycpu which is picking up x86 |
Test for #1952
The NuGet package includes native libraries too.